<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>title</title>
<link rel="stylesheet" href="../assets/agile/css/ratchet/css/ratchet.min.css">
<link rel="stylesheet" href="../assets/agile/css/flat/flat.component.css">
<link rel="stylesheet" href="../assets/agile/css/flat/flat.color.css">
<link rel="stylesheet" href="../assets/agile/css/flat/iconline.css">
<link rel="stylesheet" href="../assets/app/css/app.css" />
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/jquery.js"></script>
<script type="text/javascript" src="../script/config.js"></script>
<script type="text/javascript" src="../script/local.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
<style type="text/css">.oneget{background:#C81623;margin:5px auto 0 auto;width:100%;height:30px;line-height:30px;}</style>
</head>
<body style="background:#fff !important;">
<!--通用顶部-->
<div id="ios-top-box">
    <div id="header" class="bar bar-nav">
    <div class="titlebar">
    <a href="javascript:appClose('freewin',api);"><i class="iconfont iconline-arrow-left"></i></a>
    <h1 class="title">优品直购</h1>
    </div>
    </div>
</div>
<!--通用顶部结束-->
<section>
<div class="container jx_goods">

<div class="goodslist" id="default_go">
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><p>市场价：<del>￥9999.99</del></p><div class="info"><div class="clear"></div><button class="common-btn oneget">立即购买</button></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><p>市场价：<del>￥9999.99</del></p><div class="info"><div class="clear"></div><button class="common-btn oneget">立即购买</button></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><p>市场价：<del>￥9999.99</del></p><div class="info"><div class="clear"></div><button class="common-btn oneget">立即购买</button></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><p>市场价：<del>￥9999.99</del></p><div class="info"><div class="clear"></div><button class="common-btn oneget">立即购买</button></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><p>市场价：<del>￥9999.99</del></p><div class="info"><div class="clear"></div><button class="common-btn oneget">立即购买</button></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><p>市场价：<del>￥9999.99</del></p><div class="info"><div class="clear"></div><button class="common-btn oneget">立即购买</button></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><p>市场价：<del>￥9999.99</del></p><div class="info"><div class="clear"></div><button class="common-btn oneget">立即购买</button></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><p>市场价：<del>￥9999.99</del></p><div class="info"><div class="clear"></div><button class="common-btn oneget">立即购买</button></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><p>市场价：<del>￥9999.99</del></p><div class="info"><div class="clear"></div><button class="common-btn oneget">立即购买</button></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><p>市场价：<del>￥9999.99</del></p><div class="info"><div class="clear"></div><button class="common-btn oneget">立即购买</button></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><p>市场价：<del>￥9999.99</del></p><div class="info"><div class="clear"></div><button class="common-btn oneget">立即购买</button></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><p>市场价：<del>￥9999.99</del></p><div class="info"><div class="clear"></div><button class="common-btn oneget">立即购买</button></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><p>市场价：<del>￥9999.99</del></p><div class="info"><div class="clear"></div><button class="common-btn oneget">立即购买</button></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><p>市场价：<del>￥9999.99</del></p><div class="info"><div class="clear"></div><button class="common-btn oneget">立即购买</button></div></figcaption></figure>
</div>
    
</div>
</section>

<script type="text/javascript">
apiready = function(){
	
$(function(){
	$('.head_a a').click(function(){
	    $('.head_a a').removeClass('selected_bottom');
	    $(this).addClass('selected_bottom');
	});
	
	$('body').on('click','.goods_click',function(){
		var z_goods_id = $(this).attr('item');
		if(!z_goods_id){
			api.alert({msg:'参数错误'});
			return;
		}
		localData.set('z_goods_id',z_goods_id);
		api.openWin({name:'z_item',url:'./z_item.html',reload:true});
	});
	
});
	
	lyzimg();
default_go();
	
};

function default_list(){
	$('.title').text('0元专区');
	GetJPData(config.url+'/app.php?act=free&type=free',{},function(data){
		if(data['status']){
			var html = '';
			for(var i in data['data']){
				html += '<figure><div class="goods_click" item="'+data['data'][i]['id']+'"><a href="javascript:;"><img class="lazy" data-original="'+config.upload_url+'/'+data['data'][i]['thumb']+'" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;" class="goods_click" item="'+data['data'][i]['id']+'">'+data['data'][i]['title']+'</a></p><p>市场价：<del>￥'+data['data'][i]['oldmoney']+'</del></p><div class="info"><div class="clear"></div><button class="common-btn oneget goods_click" item="'+data['data'][i]['id']+'">0元购</button></div></figcaption></figure>';
			}
			$('#default_go').hide();
			$('#default_list').html(html).fadeIn();
			lyzimg();
		}
	});
}

function default_go(){
	$('.title').text('优品直购');
	GetJPData(config.url+'/app.php?act=free',{},function(data){
		if(data['status']){
			var html = '';
			for(var i in data['data']){
				html += '<figure><div class="goods_click" item="'+data['data'][i]['id']+'"><a href="javascript:;"><img class="lazy" data-original="'+config.upload_url+'/'+data['data'][i]['thumb']+'" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;" class="goods_click" item="'+data['data'][i]['id']+'">'+data['data'][i]['title']+'</a></p><p>商城价：￥'+data['data'][i]['money']+'</p><div class="info"><div class="clear"></div><button class="common-btn oneget goods_click" item="'+data['data'][i]['id']+'">立即购买</button></div></figcaption></figure>';
			}
			$('#default_list').hide();
			$('#default_go').html(html).fadeIn();
			lyzimg();
		}
	});
}



</script>
</body>
</html>